package com.toman.Adpter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;

import com.toman.Adpter.holder.itemDataHolder;
import com.toman.R;
import com.toman.bean.ItemDataBean;

import java.util.List;

/**
 * Created by 邹苏隆 on 2018/8/1.
 * description：
 */

public class GirdItemDataAdapter extends AdapterBase<ItemDataBean,itemDataHolder> {
    private LayoutInflater inflater;
    private Context mContext;

    public GirdItemDataAdapter( Context mContext) {
        inflater = LayoutInflater.from(mContext);
        this.mContext = mContext;
    }

    @Override
    protected void handlerData(List<ItemDataBean> mList2, int position, itemDataHolder itemView) {
        ItemDataBean bean = mList2.get(position);
        itemView.tv_name.setText(bean.getTitle());
        itemView.tv_data.setText(bean.getData());
    }

    @Override
    protected itemDataHolder getItemViewHolder() {
        return  new itemDataHolder();
    }

    @Override
    protected View initConvertView(View convertView, itemDataHolder v) {
        convertView = inflater.inflate(R.layout.item_data, null);

        v.tv_name = (TextView) convertView
                .findViewById(R.id.tv_name);
        v.tv_data = (TextView) convertView
                .findViewById(R.id.tv_data);

        return convertView;
    }

    @Override
    protected void onReachBottom() {

    }
}
